//
// Decompiled with: Decompiler.NET, Version=1.3.1.18439, Culture=neutral, PublicKeyToken=null, Version: 1.3.1.18439
// Decompilation Started at: 3/15/2009 10:34:26 PM
// Copyright 2003 - 2004, Jungle Creatures, Inc., All Rights Reserved. 
// Written by Jonathan Pierce, Email: support@junglecreatures.com
//

namespace PatientManagement

{
		
		#region Namespace Import Declarations
		
			using CrystalDecisions.CrystalReports.Engine;
			using CrystalDecisions.Windows.Forms;
			using PatientManagement.Report;
			using System.ComponentModel;
			using System.Data.Common;
			using System.Data.SqlClient;
			using System.Data;
			using System.Drawing;
			using System.Globalization;
			using System;
			using System.Resources;
			using System.Windows.Forms;
			
		#endregion
		
	public class frmBaoCaoCuoiNgay : Form
	
	{
		
		#region Fields
			private Button btExit;
			private Button btXem;
			private ComboBox cbDoctorName;
			private ComboBox cboBaoCao;
			private ComboBox cboLoaiBenh;
			private CheckBox chkAll;
			private CheckBox chkAllSick;
			private Container components;
			private string connStr;
			private DateTimePicker ddlNgayA;
			private DateTimePicker ddlNgayB;
			private dsInvoice dsInvoice1;
			public int flag;
			private int kq;
			private Label label1;
			private Label label2;
			private Label label3;
			private Label label4;
			private Label label5;
			private Label label8;
			private CrystalReportViewer report;
			private string sql;
			private SqlConnection sqlConnection1;
			private SqlDataAdapter sqlDataAdapter1;
			private SqlCommand sqlInsertCommand1;
			private SqlCommand sqlSelectCommand1;
		#endregion
		
		#region Constructors
		
			public frmBaoCaoCuoiNgay ()
			
			{
				this.components = ((System.ComponentModel.Container) null);
				this.flag = 1;
				this.sql = string.Empty;
				this.InitializeComponent ();
				this.connStr = Connection.ConnectionString ();
				return;
			}
			
		#endregion
		
		#region Methods
		
			private void btExit_Click (object sender, EventArgs e)
			
			{
				base.Close ();
				return;
			}
			
			private void btXem_Click (object sender, EventArgs e)
			
			{
				string theString;
				string theString2;
				SqlConnection theSqlConnection;
				SqlDataAdapter theSqlDataAdapter;
				DataSet theDataSet;
				SubReport theSubReport;
				SqlConnection theSqlConnection2;
				SqlDataAdapter theSqlDataAdapter2;
				DataSet theDataSet2;
				ReportChanDoan theReportChanDoan;
				SqlConnection theSqlConnection3;
				SqlDataAdapter theSqlDataAdapter3;
				DataSet theDataSet3;
				ReportChanDoanNgoaiDS theReportChanDoanNgoaiDS;
				string theString3;
				object[] theObjectArray;
				string[] theStringArray;
				object[] theObjectArray2;
				string[] theStringArray2;
				object[] theObjectArray3;
				string[] theStringArray3;
				object[] theObjectArray4;
				string[] theStringArray4;
				if (this.cboBaoCao.Text != "")
				{
					goto L_002F;
				}
				DialogResult theDialogResult = MessageBox.Show ("Vui l?ng ch?n m?u b?o c?o c?n xem", "M?u B?o C?o", MessageBoxButtons.OK, MessageBoxIcon.Hand);
				goto L_0695;
				
			L_002F:
				
				{
				}
				this.ddlNgayA.CustomFormat = "MM/dd/yyyy";
				this.ddlNgayB.CustomFormat = "MM/dd/yyyy";
				theString = this.cboBaoCao.SelectedItem.ToString ();
				theString2 = string.Empty;
				if (this.cboLoaiBenh.Items.Count != 0)
				{
					goto L_0090;
				}
				DialogResult theDialogResult2 = MessageBox.Show ("Hi?n t?i ch?a c? lo?i b?nh ?? th?ng k?", "Th?ng B?o", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				goto L_0695;
				
			L_0090:
				
				{
				}
				
			L_00A1:
				
				{
				}
				if ((theString3 = theString) == null)
				{
					goto L_0695;
				}
				theString3 = string.IsInterned (theString3);
				if (theString3 == "Doanh Thu")
				{
					goto L_00D9;
				}
				if (theString3 == "Ch?n ?o?n")
				{
					goto L_025D;
				}
				if (theString3 == "Ch?n ?o?n Ngo?i Danh S?ch")
				{
					goto L_0513;
				}
				goto L_0695;
				
			L_00D9:
				
				{
				}
				theSqlConnection = new SqlConnection (this.connStr);
				if (this.chkAll.Checked)
				{
					goto L_015A;
				}
				theObjectArray = new object[7];
				theObjectArray[0] = "SELECT distinct * FROM vw_ClinicalInvoices WHERE empISN=";
				theObjectArray[1] = this.cbDoctorName.SelectedValue;
				theObjectArray[2] = " AND (clrExaminationDate  between \'";
				theObjectArray[3] = this.ddlNgayA.Text;
				theObjectArray[4] = " 00:00:00 AM\' and \'";
				theObjectArray[5] = this.ddlNgayB.Text;
				theObjectArray[6] = " 00:00:00 AM\') and ((invExaminationPayment IS not NULL ) and (invMedicinePayment"
				+ " IS not NULL ) and (invMedicineSkillPayment IS not null ) and (invSurgeryPayment"
				+ " IS not NULL ))";
				this.sql = string.Concat (theObjectArray);
				goto L_01A8;
				
			L_015A:
				
				{
				}
				theStringArray = new string[5];
				theStringArray[0] = "SELECT distinct * FROM vw_ClinicalInvoices WHERE (clrExaminationDate  between \'";
				theStringArray[1] = this.ddlNgayA.Text;
				theStringArray[2] = " 00:00:00 AM\' and \'";
				theStringArray[3] = this.ddlNgayB.Text;
				theStringArray[4] = " 00:00:00 AM\') and ((invExaminationPayment IS not NULL ) and (invMedicinePayment"
				+ " IS not NULL ) and (invMedicineSkillPayment IS not null ) and (invSurgeryPayment"
				+ " IS not NULL ))";
				this.sql = string.Concat (theStringArray);
				
			L_01A8:
				
				{
				}
				theSqlDataAdapter = new SqlDataAdapter (this.sql, theSqlConnection);
				theDataSet = new DataSet ();
				this.kq = theSqlDataAdapter.Fill (theDataSet, "vw_ClinicalInvoices");
				if (this.kq != 0)
				{
					goto L_021B;
				}
				this.ddlNgayA.CustomFormat = "dd/MM/yyyy";
				this.ddlNgayB.CustomFormat = "dd/MM/yyyy";
				DialogResult theDialogResult3 = MessageBox.Show ("B?o c?o hi?n ch?a c? d? li?u.Xin vui l?ng ch?n l?i th?ng ho?c t?n b?c s?", "Th?ng B?o", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				this.report.ReportSource = null;
				goto L_0695;
				
			L_021B:
				
				{
				}
				this.ddlNgayA.CustomFormat = "dd/MM/yyyy";
				this.ddlNgayB.CustomFormat = "dd/MM/yyyy";
				theSubReport = new SubReport ();
				theSubReport.SetDataSource (theDataSet);
				this.report.ReportSource = theSubReport;
				goto L_0695;
				
			L_025D:
				
				{
				}
				theSqlConnection2 = new SqlConnection (this.connStr);
				if (! this.chkAllSick.Checked)
				{
					goto L_02EF;
				}
				if (this.chkAll.Checked)
				{
					goto L_02EF;
				}
				theObjectArray2 = new object[7];
				theObjectArray2[0] = "SELECT distinct * FROM vw_PathologicalClinical WHERE empISN=";
				theObjectArray2[1] = this.cbDoctorName.SelectedValue;
				theObjectArray2[2] = " AND (clrExaminationDate  between \'";
				theObjectArray2[3] = this.ddlNgayA.Text;
				theObjectArray2[4] = " 00:00:00 AM\' and \'";
				theObjectArray2[5] = this.ddlNgayB.Text;
				theObjectArray2[6] = " 00:00:00 AM\') and pltName is not null";
				this.sql = string.Concat (theObjectArray2);
				goto L_045B;
				
			L_02EF:
				
				{
				}
				if (! this.chkAll.Checked)
				{
					goto L_035C;
				}
				if (! this.chkAllSick.Checked)
				{
					goto L_035C;
				}
				theStringArray2 = new string[5];
				theStringArray2[0] = "SELECT distinct * FROM vw_PathologicalClinical WHERE (clrExaminationDate  betwee"
				+ "n \'";
				theStringArray2[1] = this.ddlNgayA.Text;
				theStringArray2[2] = " 00:00:00 AM\' and \'";
				theStringArray2[3] = this.ddlNgayB.Text;
				theStringArray2[4] = " 00:00:00 AM\') and pltName is not null";
				this.sql = string.Concat (theStringArray2);
				goto L_045B;
				
			L_035C:
				
				{
				}
				if (this.chkAll.Checked)
				{
					goto L_03F7;
				}
				if (this.chkAllSick.Checked)
				{
					goto L_03F7;
				}
				theString2 = this.cboLoaiBenh.SelectedValue.ToString ();
				theObjectArray3 = new object[8];
				theObjectArray3[0] = "SELECT distinct * FROM vw_PathologicalClinical WHERE empISN=";
				theObjectArray3[1] = this.cbDoctorName.SelectedValue;
				theObjectArray3[2] = " AND (clrExaminationDate  between \'";
				theObjectArray3[3] = this.ddlNgayA.Text;
				theObjectArray3[4] = " 00:00:00 AM\' and \'";
				theObjectArray3[5] = this.ddlNgayB.Text;
				theObjectArray3[6] = " 00:00:00 AM\') and pltISN = ";
				theObjectArray3[7] = theString2;
				this.sql = string.Concat (theObjectArray3);
				goto L_045B;
				
			L_03F7:
				
				{
				}
				theString2 = this.cboLoaiBenh.SelectedValue.ToString ();
				theStringArray3 = new string[6];
				theStringArray3[0] = "SELECT distinct * FROM vw_PathologicalClinical WHERE (clrExaminationDate  betwee"
				+ "n \'";
				theStringArray3[1] = this.ddlNgayA.Text;
				theStringArray3[2] = " 00:00:00 AM\' and \'";
				theStringArray3[3] = this.ddlNgayB.Text;
				theStringArray3[4] = " 00:00:00 AM\') and pltISN = ";
				theStringArray3[5] = theString2;
				this.sql = string.Concat (theStringArray3);
				
			L_045B:
				
				{
				}
				theSqlDataAdapter2 = new SqlDataAdapter (this.sql, theSqlConnection2);
				theDataSet2 = new DataSet ();
				this.kq = theSqlDataAdapter2.Fill (theDataSet2, "vw_PathologicalClinical");
				if (this.kq != 0)
				{
					goto L_04D1;
				}
				this.ddlNgayA.CustomFormat = "dd/MM/yyyy";
				this.ddlNgayB.CustomFormat = "dd/MM/yyyy";
				DialogResult theDialogResult4 = MessageBox.Show ("B?o c?o hi?n ch?a c? d? li?u.Xin vui l?ng ch?n l?i th?ng ho?c t?n b?c s?", "Th?ng B?o", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				this.report.ReportSource = null;
				goto L_0695;
				
			L_04D1:
				
				{
				}
				this.ddlNgayA.CustomFormat = "dd/MM/yyyy";
				this.ddlNgayB.CustomFormat = "dd/MM/yyyy";
				theReportChanDoan = new ReportChanDoan ();
				theReportChanDoan.SetDataSource (theDataSet2);
				this.report.ReportSource = theReportChanDoan;
				goto L_0695;
				
			L_0513:
				
				{
				}
				theSqlConnection3 = new SqlConnection (this.connStr);
				if (this.chkAll.Checked)
				{
					goto L_0595;
				}
				theObjectArray4 = new object[7];
				theObjectArray4[0] = "SELECT distinct * FROM vw_PathologicalClinical WHERE empISN=";
				theObjectArray4[1] = this.cbDoctorName.SelectedValue;
				theObjectArray4[2] = " AND (clrExaminationDate  between \'";
				theObjectArray4[3] = this.ddlNgayA.Text;
				theObjectArray4[4] = " 00:00:00 AM\' and \'";
				theObjectArray4[5] = this.ddlNgayB.Text;
				theObjectArray4[6] = " 00:00:00 AM\') and polPathologicalSignsOutList is not null and polPathologicalSi"
				+ "gnsOutList <> \'\'";
				this.sql = string.Concat (theObjectArray4);
				goto L_05E3;
				
			L_0595:
				
				{
				}
				theStringArray4 = new string[5];
				theStringArray4[0] = "SELECT distinct * FROM vw_PathologicalClinical WHERE (clrExaminationDate   betwe"
				+ "en \'";
				theStringArray4[1] = this.ddlNgayA.Text;
				theStringArray4[2] = " 00:00:00 AM\' and \'";
				theStringArray4[3] = this.ddlNgayB.Text;
				theStringArray4[4] = " 00:00:00 AM\') and polPathologicalSignsOutList is not null and polPathologicalSi"
				+ "gnsOutList <> \'\'";
				this.sql = string.Concat (theStringArray4);
				
			L_05E3:
				
				{
				}
				theSqlDataAdapter3 = new SqlDataAdapter (this.sql, theSqlConnection3);
				theDataSet3 = new DataSet ();
				this.kq = theSqlDataAdapter3.Fill (theDataSet3, "vw_PathologicalClinical");
				if (this.kq != 0)
				{
					goto L_0656;
				}
				this.ddlNgayA.CustomFormat = "dd/MM/yyyy";
				this.ddlNgayB.CustomFormat = "dd/MM/yyyy";
				DialogResult theDialogResult5 = MessageBox.Show ("B?o c?o hi?n ch?a c? d? li?u.Xin vui l?ng ch?n l?i th?ng ho?c t?n b?c s?", "Th?ng B?o", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				this.report.ReportSource = null;
				goto L_0695;
				
			L_0656:
				
				{
				}
				this.ddlNgayA.CustomFormat = "dd/MM/yyyy";
				this.ddlNgayB.CustomFormat = "dd/MM/yyyy";
				theReportChanDoanNgoaiDS = new ReportChanDoanNgoaiDS ();
				theReportChanDoanNgoaiDS.SetDataSource (theDataSet3);
				this.report.ReportSource = theReportChanDoanNgoaiDS;
				goto L_0695;
				
			L_0695:
				return;
			}
			
			private void cboBaoCao_SelectedIndexChanged (object sender, EventArgs e)
			
			{
				if (this.cboBaoCao.SelectedItem.ToString () == "Ch?n ?o?n Ngo?i Danh S?ch")
				{
					goto L_0038;
				}
				if (this.cboBaoCao.SelectedItem.ToString () != "Doanh Thu")
				{
					goto L_0052;
				}
				
			L_0038:
				
				{
				}
				this.cboLoaiBenh.Enabled = false;
				this.chkAllSick.Enabled = false;
				goto L_0076;
				
			L_0052:
				
				{
				}
				this.cboLoaiBenh.Enabled = true;
				this.chkAllSick.Enabled = true;
				this.chkAllSick.Checked = false;
				
			L_0076:
				return;
			}
			
			private void chkAll_CheckedChanged (object sender, EventArgs e)
			
			{
				if (! this.chkAll.Checked)
				{
					goto L_001B;
				}
				this.cbDoctorName.Enabled = false;
				goto L_0027;
				
			L_001B:
				
				{
				}
				this.cbDoctorName.Enabled = true;
				
			L_0027:
				return;
			}
			
			private void chkAllSick_CheckedChanged (object sender, EventArgs e)
			
			{
				if (this.chkAllSick.Checked)
				{
					goto L_001B;
				}
				this.cboLoaiBenh.Enabled = true;
				goto L_0027;
				
			L_001B:
				
				{
				}
				this.cboLoaiBenh.Enabled = false;
				
			L_0027:
				return;
			}
			
			protected override void Dispose (bool disposing)
			
			{
				this.flag = 0;
				if (! disposing)
				{
					goto L_001D;
				}
				if (this.components == null)
				{
					goto L_001D;
				}
				this.components.Dispose ();
				
			L_001D:
				
				{
				}
				base.Dispose (disposing);
				return;
			}
			
			private void frmBaoCaoCuoiNgay_Load (object sender, EventArgs e)
			
			{
				SqlConnection theSqlConnection;
				SqlDataAdapter theSqlDataAdapter;
				DataSet theDataSet;
				SqlDataAdapter theSqlDataAdapter2;
				DataSet theDataSet2;
				theSqlConnection = new SqlConnection (this.connStr);
				theSqlDataAdapter = new SqlDataAdapter ("SELECT * FROM Employees", theSqlConnection);
				theDataSet = new DataSet ();
				int i = theSqlDataAdapter.Fill (theDataSet, "Employees");
				this.cbDoctorName.DisplayMember = "Employees.empName";
				this.cbDoctorName.ValueMember = "Employees.empISN";
				this.cbDoctorName.DataSource = theDataSet;
				int i2 = this.cboBaoCao.Items.Add ("Doanh Thu");
				int i3 = this.cboBaoCao.Items.Add ("Ch?n ?o?n");
				int i4 = this.cboBaoCao.Items.Add ("Ch?n ?o?n Ngo?i Danh S?ch");
				this.sql = "SELECT * from PathologicalTree";
				theSqlDataAdapter2 = new SqlDataAdapter (this.sql, theSqlConnection);
				theDataSet2 = new DataSet ();
				int i5 = theSqlDataAdapter2.Fill (theDataSet2, "PathologicalTree");
				this.cboLoaiBenh.DataSource = theDataSet2;
				this.cboLoaiBenh.DisplayMember = "PathologicalTree.pltName";
				this.cboLoaiBenh.ValueMember = "PathologicalTree.pltISN";
				return;
			}
			
			private void InitializeComponent ()
			
			{
				ResourceManager theResourceManager;
				DataTableMapping[] theDataTableMappingArray;
				DataColumnMapping[] theDataColumnMappingArray;
				Control[] theControlArray;
				theResourceManager = new ResourceManager (typeof (frmBaoCaoCuoiNgay));
				this.label1 = new Label ();
				this.label2 = new Label ();
				this.label3 = new Label ();
				this.ddlNgayA = new DateTimePicker ();
				this.cbDoctorName = new ComboBox ();
				this.report = new CrystalReportViewer ();
				this.chkAll = new CheckBox ();
				this.cboBaoCao = new ComboBox ();
				this.label8 = new Label ();
				this.chkAllSick = new CheckBox ();
				this.label4 = new Label ();
				this.cboLoaiBenh = new ComboBox ();
				this.btExit = new Button ();
				this.btXem = new Button ();
				this.ddlNgayB = new DateTimePicker ();
				this.label5 = new Label ();
				this.sqlDataAdapter1 = new SqlDataAdapter ();
				this.sqlInsertCommand1 = new SqlCommand ();
				this.sqlConnection1 = new SqlConnection ();
				this.sqlSelectCommand1 = new SqlCommand ();
				this.dsInvoice1 = new dsInvoice ();
				((ISupportInitialize) this.dsInvoice1).BeginInit ();
				base.SuspendLayout ();
				this.label1.Font = new System.Drawing.Font ("Verdana", 12F, FontStyle.Bold, GraphicsUnit.Point, ((byte) byte.MinValue));
				this.label1.ForeColor = Color.MediumBlue;
				this.label1.Location = new Point (368, 16);
				this.label1.Name = "label1";
				this.label1.Size = new System.Drawing.Size (184, 23);
				this.label1.TabIndex = 0;
				this.label1.Text = "B?o C?o T?ng Th?";
				this.label2.Location = new Point (533, 51);
				this.label2.Name = "label2";
				this.label2.Size = new System.Drawing.Size (28, 16);
				this.label2.TabIndex = 1;
				this.label2.Text = "T?:";
				this.label3.Location = new Point (92, 52);
				this.label3.Name = "label3";
				this.label3.Size = new System.Drawing.Size (58, 20);
				this.label3.TabIndex = 2;
				this.label3.Text = "B?c S?:";
				this.ddlNgayA.CustomFormat = "dd/MM/yyyy";
				this.ddlNgayA.Format = DateTimePickerFormat.Custom;
				this.ddlNgayA.Location = new Point (565, 47);
				this.ddlNgayA.Name = "ddlNgayA";
				this.ddlNgayA.Size = new System.Drawing.Size (103, 23);
				this.ddlNgayA.TabIndex = 3;
				this.cbDoctorName.DropDownStyle = ComboBoxStyle.DropDownList;
				this.cbDoctorName.Location = new Point (148, 47);
				this.cbDoctorName.Name = "cbDoctorName";
				this.cbDoctorName.Size = new System.Drawing.Size (192, 24);
				this.cbDoctorName.TabIndex = 4;
				this.report.ActiveViewIndex = -1;
				this.report.DisplayGroupTree = false;
				this.report.Location = new Point (16, 104);
				this.report.Name = "report";
				this.report.ReportSource = null;
				this.report.Size = new System.Drawing.Size (872, 432);
				this.report.TabIndex = 11;
				this.chkAll.Location = new Point (349, 47);
				this.chkAll.Name = "chkAll";
				this.chkAll.Size = new System.Drawing.Size (120, 24);
				this.chkAll.TabIndex = 17;
				this.chkAll.Text = "T?t c? b?c s?";
				this.chkAll.CheckedChanged += new EventHandler (this.chkAll_CheckedChanged);
				this.cboBaoCao.DropDownStyle = ComboBoxStyle.DropDownList;
				this.cboBaoCao.Location = new Point (628, 72);
				this.cboBaoCao.Name = "cboBaoCao";
				this.cboBaoCao.Size = new System.Drawing.Size (192, 24);
				this.cboBaoCao.TabIndex = 19;
				this.cboBaoCao.SelectedIndexChanged += new EventHandler (this.cboBaoCao_SelectedIndexChanged);
				this.label8.Location = new Point (532, 75);
				this.label8.Name = "label8";
				this.label8.Size = new System.Drawing.Size (104, 20);
				this.label8.TabIndex = 18;
				this.label8.Text = "M?u B?o C?o:";
				this.chkAllSick.Location = new Point (349, 72);
				this.chkAllSick.Name = "chkAllSick";
				this.chkAllSick.Size = new System.Drawing.Size (171, 24);
				this.chkAllSick.TabIndex = 20;
				this.chkAllSick.Text = "T?t c? lo?i ch?n ?o?n";
				this.chkAllSick.CheckedChanged += new EventHandler (this.chkAllSick_CheckedChanged);
				this.label4.Font = new System.Drawing.Font ("Verdana", 9F, FontStyle.Regular, GraphicsUnit.Point, ((byte) byte.MinValue));
				this.label4.Location = new Point (27, 78);
				this.label4.Name = "label4";
				this.label4.Size = new System.Drawing.Size (112, 16);
				this.label4.TabIndex = 22;
				this.label4.Text = "Lo?i Ch?n ?o?n:";
				this.label4.TextAlign = ContentAlignment.MiddleRight;
				this.cboLoaiBenh.DropDownStyle = ComboBoxStyle.DropDownList;
				this.cboLoaiBenh.Location = new Point (148, 72);
				this.cboLoaiBenh.Name = "cboLoaiBenh";
				this.cboLoaiBenh.Size = new System.Drawing.Size (192, 24);
				this.cboLoaiBenh.TabIndex = 23;
				this.btExit.FlatStyle = FlatStyle.Popup;
				this.btExit.Location = new Point (709, 104);
				this.btExit.Name = "btExit";
				this.btExit.TabIndex = 24;
				this.btExit.Text = "Tho?t";
				this.btExit.Click += new EventHandler (this.btExit_Click);
				this.btXem.FlatStyle = FlatStyle.Popup;
				this.btXem.Location = new Point (629, 104);
				this.btXem.Name = "btXem";
				this.btXem.TabIndex = 25;
				this.btXem.Text = "Xem";
				this.btXem.Click += new EventHandler (this.btXem_Click);
				this.ddlNgayB.CustomFormat = "dd/MM/yyyy";
				this.ddlNgayB.Format = DateTimePickerFormat.Custom;
				this.ddlNgayB.Location = new Point (716, 47);
				this.ddlNgayB.Name = "ddlNgayB";
				this.ddlNgayB.Size = new System.Drawing.Size (103, 23);
				this.ddlNgayB.TabIndex = 27;
				this.label5.Location = new Point (677, 50);
				this.label5.Name = "label5";
				this.label5.Size = new System.Drawing.Size (42, 16);
				this.label5.TabIndex = 26;
				this.label5.Text = "??n:";
				this.sqlDataAdapter1.InsertCommand = this.sqlInsertCommand1;
				this.sqlDataAdapter1.SelectCommand = this.sqlSelectCommand1;
				theDataColumnMappingArray = new DataColumnMapping[14];
				theDataColumnMappingArray[0] = new DataColumnMapping ("invExaminationPayment", "invExaminationPayment");
				theDataColumnMappingArray[1] = new DataColumnMapping ("invMedicinePayment", "invMedicinePayment");
				theDataColumnMappingArray[2] = new DataColumnMapping ("invMedicineSkillPayment", "invMedicineSkillPayment");
				theDataColumnMappingArray[3] = new DataColumnMapping ("clrISN", "clrISN");
				theDataColumnMappingArray[4] = new DataColumnMapping ("patID", "patID");
				theDataColumnMappingArray[5] = new DataColumnMapping ("patName", "patName");
				theDataColumnMappingArray[6] = new DataColumnMapping ("patISN", "patISN");
				theDataColumnMappingArray[7] = new DataColumnMapping ("clrDoctorPrescription", "clrDoctorPrescription");
				theDataColumnMappingArray[8] = new DataColumnMapping ("empName", "empName");
				theDataColumnMappingArray[9] = new DataColumnMapping ("empISN", "empISN");
				theDataColumnMappingArray[10] = new DataColumnMapping ("clrExaminationDate", "clrExaminationDate");
				theDataColumnMappingArray[11] = new DataColumnMapping ("invSurgeryPayment", "invSurgeryPayment");
				theDataColumnMappingArray[12] = new DataColumnMapping ("pltISN", "pltISN");
				theDataColumnMappingArray[13] = new DataColumnMapping ("pltName", "pltName");
				theDataTableMappingArray = new DataTableMapping[1];
				theDataTableMappingArray[0] = new DataTableMapping ("Table", "vw_ClinicalInvoices", theDataColumnMappingArray);
				this.sqlDataAdapter1.TableMappings.AddRange (theDataTableMappingArray);
				this.sqlInsertCommand1.CommandText = "INSERT INTO vw_ClinicalInvoices(invExaminationPayment, invMedicinePayment, invMe"
				+ "dicineSkillPayment, clrISN, patID, patName, patISN, clrDoctorPrescription, empNa"
				+ "me, empISN, clrExaminationDate, invSurgeryPayment, pltISN, pltName) VALUES (@inv"
				+ "ExaminationPayment, @invMedicinePayment, @invMedicineSkillPayment, @clrISN, @pat"
				+ "ID, @patName, @patISN, @clrDoctorPrescription, @empName, @empISN, @clrExaminatio"
				+ "nDate, @invSurgeryPayment, @pltISN, @pltName); SELECT invExaminationPayment, inv"
				+ "MedicinePayment, invMedicineSkillPayment, clrISN, patID, patName, patISN, clrDoc"
				+ "torPrescription, empName, empISN, clrExaminationDate, invSurgeryPayment, pltISN,"
				+ " pltName FROM vw_ClinicalInvoices";
				this.sqlInsertCommand1.Connection = this.sqlConnection1;
				SqlParameter theSqlParameter = this.sqlInsertCommand1.Parameters.Add (new SqlParameter ("@invExaminationPayment", SqlDbType.Money, 8, "invExaminationPayment"));
				SqlParameter theSqlParameter2 = this.sqlInsertCommand1.Parameters.Add (new SqlParameter ("@invMedicinePayment", SqlDbType.Money, 8, "invMedicinePayment"));
				SqlParameter theSqlParameter3 = this.sqlInsertCommand1.Parameters.Add (new SqlParameter ("@invMedicineSkillPayment", SqlDbType.Money, 8, "invMedicineSkillPayment"));
				SqlParameter theSqlParameter4 = this.sqlInsertCommand1.Parameters.Add (new SqlParameter ("@clrISN", SqlDbType.Int, 4, "clrISN"));
				SqlParameter theSqlParameter5 = this.sqlInsertCommand1.Parameters.Add (new SqlParameter ("@patID", SqlDbType.VarChar, 10, "patID"));
				SqlParameter theSqlParameter6 = this.sqlInsertCommand1.Parameters.Add (new SqlParameter ("@patName", SqlDbType.NVarChar, 50, "patName"));
				SqlParameter theSqlParameter7 = this.sqlInsertCommand1.Parameters.Add (new SqlParameter ("@patISN", SqlDbType.Int, 4, "patISN"));
				SqlParameter theSqlParameter8 = this.sqlInsertCommand1.Parameters.Add (new SqlParameter ("@clrDoctorPrescription", SqlDbType.NVarChar, 1000, "clrDoctorPrescription"));
				SqlParameter theSqlParameter9 = this.sqlInsertCommand1.Parameters.Add (new SqlParameter ("@empName", SqlDbType.NVarChar, 50, "empName"));
				SqlParameter theSqlParameter10 = this.sqlInsertCommand1.Parameters.Add (new SqlParameter ("@empISN", SqlDbType.Int, 4, "empISN"));
				SqlParameter theSqlParameter11 = this.sqlInsertCommand1.Parameters.Add (new SqlParameter ("@clrExaminationDate", SqlDbType.DateTime, 8, "clrExaminationDate"));
				SqlParameter theSqlParameter12 = this.sqlInsertCommand1.Parameters.Add (new SqlParameter ("@invSurgeryPayment", SqlDbType.Money, 8, "invSurgeryPayment"));
				SqlParameter theSqlParameter13 = this.sqlInsertCommand1.Parameters.Add (new SqlParameter ("@pltISN", SqlDbType.Int, 4, "pltISN"));
				SqlParameter theSqlParameter14 = this.sqlInsertCommand1.Parameters.Add (new SqlParameter ("@pltName", SqlDbType.NVarChar, 100, "pltName"));
				this.sqlConnection1.ConnectionString = "data source=ASP3;initial catalog=ClinicalRecord;persist security info=False;user"
				+ " id=clinical;workstation id=ASP1;packet size=4096";
				this.sqlSelectCommand1.CommandText = "SELECT invExaminationPayment, invMedicinePayment, invMedicineSkillPayment, clrIS"
				+ "N, patID, patName, patISN, clrDoctorPrescription, empName, empISN, clrExaminatio"
				+ "nDate, invSurgeryPayment, pltISN, pltName FROM vw_ClinicalInvoices";
				this.sqlSelectCommand1.Connection = this.sqlConnection1;
				this.dsInvoice1.DataSetName = "dsInvoice";
				this.dsInvoice1.Locale = new CultureInfo ("en-US");
				this.dsInvoice1.Namespace = "http://www.tempuri.org/dsInvoice.xsd";
				this.AutoScaleBaseSize = new System.Drawing.Size (7, 16);
				base.ClientSize = new System.Drawing.Size (902, 547);
				theControlArray = new Control[16];
				theControlArray[0] = ((Control) this.cboBaoCao);
				theControlArray[1] = ((Control) this.label8);
				theControlArray[2] = ((Control) this.ddlNgayB);
				theControlArray[3] = ((Control) this.label5);
				theControlArray[4] = ((Control) this.btXem);
				theControlArray[5] = ((Control) this.btExit);
				theControlArray[6] = ((Control) this.cboLoaiBenh);
				theControlArray[7] = ((Control) this.label4);
				theControlArray[8] = ((Control) this.chkAllSick);
				theControlArray[9] = ((Control) this.chkAll);
				theControlArray[10] = ((Control) this.report);
				theControlArray[11] = ((Control) this.cbDoctorName);
				theControlArray[12] = ((Control) this.ddlNgayA);
				theControlArray[13] = ((Control) this.label3);
				theControlArray[14] = ((Control) this.label2);
				theControlArray[15] = ((Control) this.label1);
				base.Controls.AddRange (theControlArray);
				this.Font = new System.Drawing.Font ("Verdana", 9.75F, FontStyle.Regular, GraphicsUnit.Point, ((byte) byte.MinValue));
				base.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
				base.Icon = ((System.Drawing.Icon) theResourceManager.GetObject ("$this.Icon"));
				base.MaximizeBox = false;
				base.MinimizeBox = false;
				base.Name = "frmBaoCaoCuoiNgay";
				base.StartPosition = FormStartPosition.CenterScreen;
				this.Text = "B?o C?o T?ng Th?";
				base.Load += new EventHandler (this.frmBaoCaoCuoiNgay_Load);
				((ISupportInitialize) this.dsInvoice1).EndInit ();
				base.ResumeLayout (false);
				return;
			}
			
			private void Report_HandleException (object source, ExceptionEventArgs e)
			
			{
				EngineException theEngineException;
				if ((e.Exception as EngineException) == null)
				{
					goto L_0059;
				}
				theEngineException = ((EngineException) e.Exception);
				if (theEngineException.ErrorID != EngineExceptionErrorID.DataSourceError)
				{
					goto L_003A;
				}
				e.Handled = true;
				DialogResult theDialogResult = MessageBox.Show ("An error has occurred while connecting to the database.");
				goto L_0059;
				
			L_003A:
				
				{
				}
				if (theEngineException.ErrorID != EngineExceptionErrorID.LogOnFailed)
				{
					goto L_0059;
				}
				e.Handled = true;
				DialogResult theDialogResult2 = MessageBox.Show ("Incorrect Logon Parameters. Check your user name and password.");
				
			L_0059:
				
				{
				}
				if ((e.Exception as ExecutionEngineException) == null)
				{
					goto L_0078;
				}
				e.Handled = true;
				DialogResult theDialogResult3 = MessageBox.Show ("ExecutionEngineException");
				
			L_0078:
				return;
			}
			
		#endregion
	}
	
}

